﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace CollisionDetectionSandbox
{
    class Button
    {
       
        public const int BUTTON_HEIGHT = 60,
                     BUTTON_WIDTH = 150;
        int x;
        int y;
        Rectangle button_rectangle = new Rectangle();

        Texture2D mButtonTexture;

        public Button(ContentManager theContent, String FileName, int a, int b)
        {
            mButtonTexture = theContent.Load<Texture2D>(FileName);
            x = a;
            y = b;
            button_rectangle = new Rectangle(x, y, BUTTON_WIDTH, BUTTON_HEIGHT);
        }

        public void Draw(SpriteBatch theBatch)
        {
            theBatch.Draw(mButtonTexture, button_rectangle, Color.White);
        }

        public Boolean hit_image(float tx, float ty)
        {
            return (tx >= x &&
                tx <= x + mButtonTexture.Width &&
                ty >= y &&
                ty <= y + mButtonTexture.Height);
        }
    }
}
